import axios from 'axios'
import variable from '../../common/variable'


function get(url,param) {
  return new Promise(function (resolve, reject) {
    axios.get(url,{params:param}).then(function (rs) {
      if (rs.status == 200) {
        resolve(rs.data)
      } else {
        reject(rs.statusText)
      }
    }, function (err) {
      reject(err)
    })
  })
}

export function getGameGroup(param = {}) {
  return get(variable.BASE_API + '/api/java/game/group/list', param)
}
export function getKnock(param = {}) {
  return get(variable.BASE_API + '/api/java/game/knock/list' , param)
}

export function getCountry(type = '') {
  return get(variable.BASE_API + '/api/java/country/list?type=worldcup')
}


export function getHotCountry(limit = 3) {
  return get(variable.BASE_API + '/api/java/country/list/limit/' + limit)
}



export function getAllCity() {
  return get(variable.BASE_API + '/api/java/game/getAllCity')
}


export function getHotCity() {
  return get(variable.BASE_API + '/api/java/game/getHotCity')
}


